package com.huikaka.service;

import com.huikaka.entity.User;
import com.huikaka.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

//    通过openid查看用户信息
    public User findUserByOpenId(String openId) {
        return userMapper.findUserByOpenId(openId);
    }

//    添加用户
    public Integer addUser(String openId,String inviteCode,String nickName,String headerUrl,String role){
        return userMapper.addUser(openId,inviteCode,nickName,headerUrl,role);
    }

//    通过邀请码查看用户信息
    public User findUserByInviteCode(String inviteCode){
        return userMapper.findUserByInviteCode(inviteCode);
    }


}
